package com.easydl.project.config;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.stereotype.Component;

@Component
public class EasydlKeyGenerator implements KeyGenerator{
	
	Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@Override
	public Object generate(Object target, Method method, Object... params) {
		return this.generateKey(params);
	}

	/**
	 * 缓存名称
	 * @param params
	 * @return
	 */
	public Object generateKey(Object... params) {
		logger.info("获取缓存key:easydl::access_token");
		return "easydl::access_token";
	}
}
